package com.backend.demo1.mapper;

import com.backend.demo1.models.Department;
import com.backend.demo1.models.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DepartmentMapper {

    // 查询所有部门
    List<Department> findAll();

    // 根据 ID 查询部门
    Department findById(Long id);

    // 插入部门
    int save(Department department);

    void update(Department department);

    // 删除部门
    void deleteById(Long id);

    // 根据部门 ID 查询用户
    List<User> findUsersByDepartmentId(Long departmentId);
}